package com.fy56.platform.goodsTracking.police.service.impl;

import com.dexcoder.dal.JdbcDao;
import com.dexcoder.dal.build.Criteria;
import com.fy56.platform.goodsTracking.commons.DateUtil;
import com.fy56.platform.goodsTracking.model.PoliceSet;
import com.fy56.platform.goodsTracking.police.service.PoliceSetService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by XTK on 2017-02-28.
 */
@Repository
public class PoliceSetServiceImpl implements PoliceSetService {
    @Autowired
    private JdbcDao jdbcDao_GoodsTracked;

    @Override
    public List<PoliceSet> list() {
       /* Criteria criteria = Criteria.select(PoliceSet.class)
                .desc("organizationcode");
        return jdbcDao_GoodsTracked.queryList(criteria);*/
        return jdbcDao_GoodsTracked.queryListForSql("select * from Police_Set", PoliceSet.class);
    }

    @Override
    public void updateTime(String column, String organizationcode) {
        jdbcDao_GoodsTracked.updateForSql("update Police_Set set " + column + "='"+ DateUtil.Now()+"' where organizationcode='" + organizationcode + "'");
    }
}
